package br.com.teste.manager.tarefa;

import br.com.teste.controller.tarefa.TarefaVo;
import br.com.teste.entity.Tarefa;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;


public class TarefaFactory {
    
    @Autowired
    TarefaManager tarefaManager;
    
    public List<TarefaVo> listar() {
        List<Tarefa> tarefaList = tarefaManager.listar();
        List<TarefaVo> voList = new ArrayList<TarefaVo>();
        
        for (Tarefa tarefa : tarefaList) {
            voList.add(new TarefaVo(tarefa));
        }
                
        return voList;
        
    }
    
}
